package com.castle.fortress.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 课程状态枚举
 * @author castle
 */
@Getter
@AllArgsConstructor
public enum CourseStatusEnum {
    DRAFT(1,"草稿","草稿"),
    PUTAWAY(2,"上架","上架"),
    SOLDOUT(3,"下架","下架"),

    ;

    Integer code;
    String name;
    String desc;

    public static Integer getCodeByDesc(String desc){
        for(BankCardTypeEnum e:BankCardTypeEnum.values()){
            if(e.getDesc().equals(desc)){
                return e.getCode();
            }
        }
        return null;
    }
}
